import React, {useEffect, useState} from 'react';
import axios from 'axios'

function App(props) {
  const [userList,setUserList] = useState([])
    const getUser = async ()=>{
      const res = await axios.get('https://api.github.com/search/repositories?q=react&sort=stars')
        setUserList(res.data.items)
    }
    useEffect(()=>{
                getUser()
              },[])

    return (
        <div>
            {
                userList.map(user=>(
                    <p key={user.id}>{user.full_name}</p>
                ))
            }
        </div>
    );
}

export default App;